home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Pascal Super Library
/
Pascal Super Library (CW International)(1997).bin
/
LIBRARY
/
VTOOLS
/
VTFAST.ASM
< prev
next >
Wrap
Assembly Source File
|
1995-02-20
|
5KB
|
141 lines
.286
DATA SEGMENT BYTE PUBLIC
EXTRN VSeg : WORD
EXTRN Voff : WORD
EXTRN VPageL : WORD
DATA ENDS
CODE SEGMENT BYTE PUBLIC
ASSUME CS:CODE,DS:DATA
Public PlainWrite
PlainWrite Proc Far
enter 0,0 ; New stack frame
push ds es ; Save old DS ES
mov ax,[bp+12d] ; Load Screen coordinates
mov bx,[bp+10d] ; -"-
dec al ; Compute to std coordinates
dec bl ;
shl bx,7 ; Compute offset of Active Video Page
mov di,bx
shr di,2
add di,bx
shl ax,1
add di,ax
add di,VOff
mov es,VSeg
mov ds,[bp+08d] ; Load String addres
mov si,[bp+06d] ; Load String offset
lodsb ; Get string length to AX
cmp al,0 ; If 0 ?
je EndPlain ; then EXIT
mov cx,ax ; load length to cx
WriteNextPlain:
movsb ; Type letter to screen
dec cx
cmp cx,0 ;Finish String ?
je EndPlain ;If yes then return
inc di ;Disable to write attributes
Jmp WriteNextPlain ;WriteNextCharacter
EndPlain:
pop es ds ; Restore old ES, DS
leave ; Leave procedure
retf 8d
PlainWrite EndP
;=======================================
Public ColorWrite
ColorWrite Proc Far
enter 0,0 ; New stack frame
push ds es ; Save old DS ES
Push si di
mov ax,[bp+16d] ; Load Screen coordinates
mov bx,[bp+14d] ; -"-
dec al ; Compute to std coordinates
dec bl ;
shl bx,8 ; Compute offset of Active Video Page
shr bx,1
mov di,bx
shr di,2
add di,bx
shl ax,1
add di,ax
add di,VOff
mov es,VSeg
mov ax,[bp+12d] ; Load Foreground
mov bx,[bp+10d] ; -"- BackGround
shl bx,4 ; Compute Attributes
add bx,ax ; BackG * 16 + ForeG
mov ds,[bp+08] ; Load String addres
mov si,[bp+06] ; Load String offset
lodsb ; Get string length to AX
cmp al,0 ; If 0 ?
je EndColor ; then EXIT
mov cx,ax ; load length to cx
WriteNextColor:
movsb ; Type letter to screen
mov al,bl ; Store attributes in AL
stosb ; Write attributes to Screen
dec cx
cmp cx,0 ;Finish String ?
je EndColor ;If yes then return
Jmp WriteNextColor ;WriteNextCharacter
EndColor:
pop di si
pop es ds ; Restore old ES, DS
leave ; Leave procedure
retf 12d
ColorWrite EndP
;========================
Public SetCharAttr
SetCharAttr proc Far
Enter 0,0 ; New Stack Frame
mov ax,[bp+10d] ; Load Screen coordinates
mov bx,[bp+08d] ; -"-
dec al ; Compute to std coordinates
dec bl ;
shl bx,8 ; Compute offset of Active Video Page
shr bx,1
mov di,bx
shr di,2
add di,bx
shl ax,1
add di,ax
add di,VOff
inc di ; increment offset to position to Attributes
mov es,VSeg
mov ax,[bp+6d] ; Load Attributes;
stosb ; Set attributes
Leave ; Leave Procedure
retf 6d
SetCharAttr endp
Public cls
cls proc far
enter 0,0
push ds es
mov es,VSeg
mov di,Voff
mov cx,VPageL
mov ax,[bp+6]
Mov ah,32d
rol ax,8
rep stosw
pop es ds
leave
ret 2
cls endp
CODE ENDS
END